package com.aote.gradleproject.service;

import com.aote.gradleproject.pojo.AlipayParameterForBangDao;
import com.aote.gradleproject.pojo.ApplicationValues;
import com.aote.gradleproject.util.Json;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 初始化, 用来开启监听程序
 * @author 张琪
 * @date 2021/7/16 16:47
 */
@Component
@Slf4j
public class Init implements ApplicationRunner {

    @Resource
    private AlipayParameterForBangDao alipayConfig;

    @Resource
    private ApplicationValues applicationValues;

    @Override
    public void run(ApplicationArguments args){
//        log.info("配置信息为:{}", Json.object2Json(alipayConfig));
//        ServerSocket socket = HttpSslSocket.createSslServerSocket(alipayConfig);
//        if (!Objects.isNull(socket)) {
//            log.info("-----正在监听端口----等待业务执行");
//        }
        log.info(Json.object2Json(applicationValues).toString(4));

    }
}
